﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using ProBugTracker.Infrastructure;
using System.ComponentModel.Composition;
using ProBugTracker.Module.Login.Interfaces;
using Microsoft.Practices.Prism.Regions;
using ProBugTracker.Module.Login.ViewModels;

namespace ProBugTracker.Module.Login.Views
{
    [Export(typeof(Login))]
    [PartCreationPolicy(CreationPolicy.NonShared)]
    public partial class Login : UserControl
    {
        [Import]
        public IRegionManager TheRegionManager { private get; set; }

        [ImportingConstructor]
        public Login()
        {
            InitializeComponent();
            btnSignIn.Click += new RoutedEventHandler(btnSignIn_Click);
        }


        void btnSignIn_Click(object sender, RoutedEventArgs e)
        {
            TheRegionManager.RequestNavigate
            (
                "MainRegion",
                new Uri("UserArea", UriKind.Relative),
                a => { }
            );
        }

        [Import]
        public ILoginViewModel ViewModel
        {
            set { this.DataContext = value; }
        }
    }
}
